import Http from '@/http';
import { dictionaryItemByCategoryApi } from './system/Dictionary';

export function saveApi(params:any) {
    return params.id ? Http.put('apps/update/' + params.id, params) : Http.post('apps/add', params)
}

export function pageApi(params:any) {
    return Http.post('apps/page?id=333', params)
}

export function deleteApi(id) {
    return Http.delete('apps/delete/' + id)
}

export async function menuTypeApi() {
    const { data } = await dictionaryItemByCategoryApi('MENU_TYPE')
    return data
}

export async function apiMethodTypeApi() {
    const { data } = await dictionaryItemByCategoryApi('REQUEST_METHOD')
    return data
}



export function appTypeApi() {
    return dictionaryItemByCategoryApi('APP_TYPE')
}

export function linkTypepeApi() {
    return dictionaryItemByCategoryApi('LINK_TYPE')
}